<{*通用文件头*}>
<!doctype html>
<html>
<head>
    <title><{$title}></title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="address=no" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" type="text/css" href="<{$preStaticUrl}>Wap/business/css/index.css?1<{$resVersion}>" />
    <script src="<{$preStaticUrl}>Wap/js/jquery-2.1.4.min.js?<{$resVersion}>"></script>
    <script src="<{$preStaticUrl}>Wap/business/js/index.js?<{$resVersion}>"></script>
    <script src="<{$preStaticUrl}>layer_mobile/layer.js?<{$resVersion}>"></script>
<script>
    var CurrentPlantform='<{$plantform}>';
    var latitude = 0;// 纬度
    var longitude = 0;// 经度
</script>

<{if $isWechat }>
    <script src=" https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script>
        wx.config({
            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
            appId: "<{$wxSign.appId}>", // 必填，公众号的唯一标识
            timestamp: "<{$wxSign.timestamp}>", // 必填，生成签名的时间戳
            nonceStr: "<{$wxSign.nonceStr}>", // 必填，生成签名的随机串
            signature:"<{$wxSign.signature}>",// 必填，签名，见附录1
            jsApiList: [
                'getLocation','openLocation',
                'checkJsApi',
                'chooseWXPay',
                <{if $isWxShare}>
                    'onMenuShareTimeline',
                    'onMenuShareAppMessage',
                <{/if}>
                'addCard',
                'scanQRCode'
            ] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
        });
        <{if $isWxShare}>
            var shareData = {
                title:"<{$wxTitle}>",
                desc: "<{$wxDesc|default:$wxTitle}>",
                link: "<{$wxLink}>",
                imgUrl: "<{$wxImage}>",
                trigger: function (res) {
                // 不要尝试在trigger中使用ajax异步请求修改本次分享的内容，因为客户端分享操作是一个同步操作，这时候使用ajax的回包会还没有返回
                // alert('用户点击发送给朋友');
                },
                success: function (res) {
                    var objType = "<{$wxObjType}>";
                    var objID = "<{$wxObjID}>";
                    var param = {objType:objType,objID:objID};
                    $.getJSON("<{U('User/weixinDayFirstShare')}>",param,function(result){
                        console.log(result);
                        if(result.status == 0 ){
                            tip(result.tip);
                        } else{
                        }
                    })
                },
                cancel: function (res) {
                },
                fail: function (res) {
                    tip('分享失败');
                }
            };
        <{/if}>




        var canpay=false;
        wx.ready(function () {

            <{if $wxLocation}>
            wx.getLocation({
                type: 'wgs84', // 默认为wgs84的gps坐标，如果要返回直接给openLocation用的火星坐标，可传入'gcj02'
                success: function (res) {
                    latitude = parseFloat(res.latitude); // 纬度，浮点数，范围为90 ~ -90
                    longitude = parseFloat(res.longitude); // 经度，浮点数，范围为180 ~ -180。
                    if(typeof loadStore =="function"){ loadStore();}
                },
                fail: function(res) {
                    tip('您未开启定位功能,可能某些服务不能正常显示');
                    if(typeof loadStore =="function"){ loadStore();}
                },
                cancel: function (res) {
                    tip('您拒绝授权获取地理位置,可能某些服务不能正常显示');
                    if(typeof loadStore =="function"){ loadStore();}
                }
            });
            <{/if}>


            <{if $isWxShare}>
                wx.onMenuShareAppMessage(shareData);
                wx.onMenuShareTimeline(shareData);
            <{/if}>
            <{if $hasUnreceive eq 1}>
                wx.addCard({
                    cardList: [{
                    cardId:  '<{$wxCardId}>',
                    cardExt: '<{$cardExt}>'
                }], // 需要添加的卡券列表
                success: function (res) {
                },
                cancel: function (res) {
                }
                });
            <{/if}>
            canpay=true;



        });
    </script>
<{/if}>